﻿using Microsoft.AspNetCore.Builder;
using ZilLion.Service.Core.Ioc;

namespace ZilLion.Service.Core.Starter.Extention
{
    public static class SpecialRouteExtention
    {
        /// <summary>
        ///     Configures Web API routes.
        /// </summary>
        public static void UseSpecialRoute(this IApplicationBuilder app)
        {
        
            app.UseMvc(routes =>
            {
                foreach (var loader in IocConfig.ComponentLoaderCache.Values)
                    loader.ConfigureSpecialRoute(routes); //注册各个模块的特殊理由,入代理功能等
            });

            app.UseMvcWithDefaultRoute();
        }
    }
}